{template '_header'}
<div class="page-header">当前位置：<span class="text-primary">提现申请</span></div>
<div class="page-content">
    <form action="./index.php" method="get" class="form-horizontal table-search" role="form" id="form1">
        <input type="hidden" name="c" value="site" />
        <input type="hidden" name="a" value="entry" />
        <input type="hidden" name="m" value="mx_shop" />
        <input type="hidden" name="do" value="web" />
        <input type="hidden" name="r" value="finance.log.withdraw" />
        <div class="page-toolbar">
              <span class="pull-left">
                    {php echo tpl_daterange('time', array('sm'=>true,'placeholder'=>'提现时间'),true);}
                </span>
            <div class="input-group">
                <span class="input-group-select">
                    <select name="status" class="form-control"   style="width:80px;"  >
                        <option value="" {if $_GPC['status']==''}selected{/if}>状态</option>
                        <option value="1" {if $_GPC['status']=='1'}selected{/if}>完成</option>
                        <option value="0" {if $_GPC['status']=='0'}selected{/if}>申请中</option>
                        <option value="-1" {if $_GPC['status']=='-1'}selected{/if}>失败</option>
                    </select>
                </span>
                <span class="input-group-select">
                    <select name="groupid" class="form-control" style="width:110px;float: right;"  >
                        <option value="">会员分组</option>
                        {loop $groups $group}
                        <option value="{$group['id']}" {if $_GPC['groupid']==$group['id']}selected{/if}>{$group['groupname']}</option>
                        {/loop}
                    </select>
                </span>
                <span class="input-group-select">
                    <select name="level" class="form-control" style="width:110px;float: right;"  >
                        <option value="">会员等级</option>
                        {loop $levels $level}
                        <option value="{$level['id']}" {if $_GPC['level']==$level['id']}selected{/if}>{$level['levelname']}</option>
                        {/loop}
                    </select>
                </span>
                <span class="input-group-select">
                    <select name="searchfield" class="form-control" style="width:110px;"  >
                        <option value="logno" {if $_GPC['searchfield']=='logno'}selected{/if}>提现单号</option>
                        <option value="member" {if $_GPC['searchfield']=='member'}selected{/if}>会员信息</option>
                    </select>
                </span>
                <input type="text" class="form-control input-sm"  name="keyword" value="{$_GPC['keyword']}" placeholder="请输入关键词" />
                <span class="input-group-btn">
                    <button class="btn btn-primary" type="submit"> 搜索</button>
                    {ifp 'finance.log.withdraw.export'}
                    <button type="submit" name="export" value="1" class="btn btn-success">导出</button>
                    {/if}
                </span>
            </div>
        </div>
    </form>

    {if empty($list)}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {else}

    <div class="row">
        <div class="col-md-12">
            <table class="table">
                <thead class="navbar-inner">
                <tr>
                    <th style='width:180px;'>充值单号</th>
                    <th>粉丝</th>
                    <th>会员信息</th>
                    <th style='width:100px;'>提现金额<br/>应到账金额<br/>手续费金额</th>
                    <th style="width: 80px;">已发送金额 <br/>(微信红包)</th>
                    <th style='width:180px;'>提现方式</th>
                    <th >提现时间</th>
                    <th style='width:100px;'>状态</th>
                    <th style='width:80px;text-align: center;'>操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list $row}
                <tr>
                    <td>
                        {if !empty($row['logno'])}
                        {if strlen($row['logno'])<=22}
                        {$row['logno']}
                        {else}
                        recharge{$row['id']}
                        {/if}
                        {else}
                        recharge{$row['id']}
                        {/if}
                    </td>
                    <td>
                        {ifp 'member.member.view'}
                        <a  href="{php echo webUrl('member/list/detail',array('id' => $row['mid']));}" target='_blank'>
                            <img class="radius50" src='{php echo tomedia($row['avatar'])}' style='width:30px;height:30px;padding1px;border:1px solid #ccc'  onerror="this.src='../addons/mx_shop/static/images/noface.png'"/> {$row['nickname']}
                        </a>
                        {else}
                        <img src='{php echo tomedia($row['avatar'])}' style='width:30px;height:30px;padding1px;border:1px solid #ccc'  class="radius50"  onerror="this.src='../addons/mx_shop/static/images/noface.png'"/> {$row['nickname']}
                        {/if}
                    </td>
                    <td>
                        {$row['realname']}<br />{$row['mobile']}
                    </td>
                    <td>{$row['money']}<br/>{$row['realmoney']}<br/>{$row['deductionmoney']}</td>
                    <td>{if (float)$row['sendmoney'] != 0}{$row['sendmoney']}{else}-{/if}</td>
                    <td title="{if empty($row['applytype'])}{$row['typestr']}{else if $row['applytype']=='2'}{$row['typestr']}{else if $row['applytype']=='3'}{$row['typestr']}{/if}{if $row['applytype'] == 2}
                        姓名:{$row['applyrealname']}
                        帐号:{$row['alipay']}
                        {else if $row['applytype'] == 3}
                        姓名:{$row['applyrealname']}
                        银行:{$row['bankname']}
                        帐号:{$row['bankcard']}
                        {/if}">
                        {if empty($row['applytype'])}
                        <span><i class="icow icow-weixin text-success"></i>{$row['typestr']}</span>
                        {else if $row['applytype']=='2'}
                        <span> <i class="icow icow-zhifubaozhifu text-primary"></i>{$row['typestr']}</span>
                        {else if $row['applytype']=='3'}
                        <span><i class="icow icow-icon text-warning"></i>{$row['typestr']}</span>
                        {/if}

                        {if $row['applytype'] == 2}
                        <br/>
                        姓名:{$row['applyrealname']}<br/>
                        帐号:<br/>{$row['alipay']}
                        {else if $row['applytype'] == 3}
                        <br/>
                        姓名:{$row['applyrealname']}<br/>
                        银行:{$row['bankname']}<br/>
                        帐号:<br/>{$row['bankcard']}
                        {/if}
                    </td>

                    <td>{php echo date('Y-m-d',$row['createtime'])}<br/>{php echo date('H:i',$row['createtime'])}</td>
                    <td>
                        {if $row['status']==0}
                        <span class='text-default'>{if $row['type']==1}申请中{else}未充值{/if}</span>
                        {else if $row['status']==1}
                        <span class='text-success'>成功</span>
                        {else if $row['status']==-1}
                        <span class='text-default'>{if $row['type']==1}拒绝{else}失败{/if}</span>
                        {else if $row['status']==3}
                        <span class='text-danger'>{if $row['type']==0}退款{/if}</span>
                        {/if}
                    </td>

                    <td  style="overflow:visible;">
                        {if $row['status']<1 && $row['status']!=-1 }

                        {if $row['status']==0 || $row['status']==-1}

                        {if $row['applytype'] < 2}
                        {ifp 'finance.log.wechat'}
                        <a  class='btn btn-op btn-operation'  data-toggle='ajaxPost' data-confirm="确认微信钱包提现?" href="{php echo webUrl('finance/log/wechat',array('id' => $row['id']));}">
                                    <span data-toggle="tooltip" data-placement="top" title="" data-original-title="微信提现">
                                        <i class="icow icow-weixinfanxian"></i>
                                    </span>
                        </a>
                        {/if}
                        {/if}

                        {if $row['applytype'] == '2'}
                        {ifp 'finance.log.alipay'}
                        <a  class='btn btn-op btn-operation' data-toggle='ajaxPost' data-confirm="确认支付宝提现?(提现成功可能需要等待两到三分钟处理完成!)" href="{php echo webUrl('finance/log/alipay',array('id' => $row['id']));}">
                                    <span data-toggle="tooltip" data-placement="top" title="" data-original-title="支付宝提现">
                                        <i class="icow icow-zhifubao"></i>
                                    </span>
                        </a>
                        {/if}
                        {/if}

                        {ifp 'finance.log.manual'}
                        <a  class='btn btn-op btn-operation' data-toggle='ajaxPost' data-confirm="确认手动提现完成?" href="{php echo webUrl('finance/log/manual',array('id' => $row['id']));}">
                                    <span data-toggle="tooltip" data-placement="top" title="" data-original-title="手动提现">
                                        <i class="icow icow-tixian"></i>
                                    </span>
                        </a>
                        {/if}

                        {/if}

                        {if $row['status']==0}
                        {ifp 'finance.log.refuse'}
                        <a  class='btn btn-op btn-operation' data-toggle='ajaxPost' data-confirm="确认拒绝提现申请?" href="{php echo webUrl('finance/log/refuse',array('id' => $row['id']));}">
                                <span data-toggle="tooltip" data-placement="top" title="" data-original-title="拒绝">
                                    <i class="icow icow-jujuejieshou"></i>
                                </span>
                        </a>
                        {/if}
                        {/if}
                        {/if}
                    </td>

                </tr>
                {/loop}
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="4">
                        <div class="btn-group"></div>
                    </td>
                    <td colspan="5" style="text-align: right">
                        <span class="pull-right" style="line-height: 28px;">(共{php echo count($list)}条记录)</span>
                        {$pager}
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
    {/if}
</div>

{template '_footer'}